<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class Question extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'question';

    function user()
    {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }

    function lawOrder()
    {
        return $this->hasOne(LawOrder::class, 'question_id', 'id');
    }

    function comment()
    {
        return $this->hasOne(Comment::class, 'question_id', 'id');
    }
}
